import java.util.Scanner;
import java.util.InputMismatchException;
public class AccountTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Account ac = new Account(1000,"1234567");
        while (true){
            try{
                System.out.println("请输入取款金额");
                double money = sc.nextDouble();
                ac.withfraw(money);//取款
                System.out.println("取款成功，余额为："+ac.getBalance());
                break;
            } catch (InputMismatchException e) {
                sc.nextLine();
                System.out.println("金额输入有问题");
            }catch (AccountException e){
                System.out.println(e.getMessage());
            }
        }
    }
}
